﻿@using LotteryVoteMVC.Core
@using LotteryVoteMVC.Core.Application
@using LotteryVoteMVC.Models
@using LotteryVoteMVC.Resources
@using LotteryVoteMVC.Utility
@model PagedList<BetUpperLimit>
@{
    ViewBag.Title = Resource.DropWater;
    Layout = "~/Views/Shared/Main.cshtml";
}
@section Header{
    <script src="@Url.Content("~/Scripts/Customer/SearchHelper.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ui.datepicker.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ui.datepicker-" + CultureHelper.GetCurrentCulture() + ".js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/TableBase.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Pager/pagerGray.css")" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $("#Date").attr("readonly", "readonly").datepicker();
        });
    </script>
}
@{int index = 1;}
<div id="searchBar">
    @using (Html.BeginForm())
    {
        if (ViewBag.User.Role == Role.Company)
        {
            <span>@Resource.Time</span>
            @Html.TextBox("Date")
        }
        <span>@Resource.Num</span>
        @Html.TextBox("Num")
        <span>@Resource.Company</span>
        @Html.Partial("~/Views/Partial/TodayCompany.cshtml", TodayLotteryCompany.Instance.GetTodayCompany())
        <span>@Resource.GameType</span>
        @Html.Partial("~/Views/Partial/GamePlayWay.cshtml", LotterySystem.Current.GamePlayWays)
        <input type="submit" name="search" id="search" value="@Resource.Search" />
    }
</div>
<table>
    <thead>
        <tr>
            <td colspan="5">
                @Resource.DropWater
            </td>
        </tr>
        <tr>
            <td>
                @Resource.No
            </td>
            <td>
                @Resource.Num
            </td>
            <td>
                @Resource.Company
            </td>
            <td>
                @Resource.GameType
            </td>
            <td>
                @Resource.DropWater
            </td>
        </tr>
    </thead>
    <tbody>
        @foreach (var limit in Model)
        { 
            <tr>
                <td>
                    @(index++)
                </td>
                <td>
                    @limit.Num
                </td>
                <td>
                    @LotterySystem.Current.FindCompany(limit.CompanyId).Name
                </td>
                <td>
                    @Extended.GetGPWDescription(limit.GamePlayWayId)
                </td>
                <td>
                    @limit.DropValue
                </td>
            </tr>
        }
    </tbody>
</table>
@Html.Pager(Model)
